const request = require('request');
/*******************stuGetInfo***********************
@get
@parames
  id char(9)
@callback

*/

exports.fn = async (ctx,next)=>{
    var params = ctx.request.body;

    try{
      let sql = `call messageAdd("${params.title}",${params.body},${params.receiveGroup},10,${params.priority})`;
      colsole.log(sql);
      let result = await ctx.mysql.query(sql);
      ctx.body = result[0];
    }catch(err){
      ctx.body = err.code;
    }
  
}